package com.jyxd.web.service.dictionary;

import com.jyxd.web.dao.dictionary.TitleDictionaryDao;
import com.jyxd.web.data.dictionary.TitleDictionary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class TitleDictionaryService {

    @Autowired
    private TitleDictionaryDao titleDictionaryDao;


    public boolean insert(TitleDictionary titleDictionary){
        return titleDictionaryDao.insert(titleDictionary);
    }

    public boolean update(TitleDictionary titleDictionary){
        return titleDictionaryDao.update(titleDictionary);
    }

    public TitleDictionary queryData(String id){
        return titleDictionaryDao.queryData(id);
    }

    public TitleDictionary queryDataByCode(String titleCode){
        return titleDictionaryDao.selectDataByCode(titleCode);
    }

    public List<TitleDictionary> queryList(Map<String,Object> map){
        return titleDictionaryDao.queryList(map);
    }

    public int queryNum(Map<String,Object> map){
        return titleDictionaryDao.queryNum(map);
    }

    /**
     * 根据code查询病区字典对象
     * @param map
     * @return
     */
    public TitleDictionary queryDataByCode(Map<String,Object> map){
        return titleDictionaryDao.queryDataByCode(map);
    }

    /**
     * 查询所有的字典数据 stats!=-1
     * @param map
     * @return
     */
    public List<TitleDictionary> queryTitleList(Map<String,Object> map){
        return titleDictionaryDao.queryTitleList(map);
    }


}
